package org.tarena.dang.action.main;

import java.sql.SQLException;
import java.util.List;

import org.tarena.dang.action.BaseAction;
import org.tarena.dang.entity.Product;
import org.tarena.dang.service.ProductService;
import org.tarena.dang.service.ProductServiceImp;

public class NewProductAction extends BaseAction {
	private List<Product> pros;
	//action配置注入
	private int topSize;
	public String execute(){
		//获取 最新上架图书转向到new.jsp
		ProductService productService = new ProductServiceImp();
		try {
			pros = productService.findNewPros(topSize);
		} catch (SQLException e) {
			//Auto-generated catch block
			e.printStackTrace();
		}
		return "success";
	}
	public List<Product> getPros() {
		return pros;
	}
	public void setPros(List<Product> pros) {
		this.pros = pros;
	}
	public int getTopSize() {
		return topSize;
	}
	public void setTopSize(int topSize) {
		this.topSize = topSize;
	}
	
	
}
